package main

import "fmt"

type person struct {
    name string
    age int
}

func Older(p1,p2 person) (person, int){
    if p1.age > p2.age {
        return p1,p1.age - p2.age
    }
    return p2,p2.age - p1.age
}

//test method
type Rectangle struct {
    width,height float64
}
func area(r Rectangle) float64 {
    return r.width*r.height
}


func main() {
    var tom person

    tom.name,tom.age = "Tom",18

    bob := person{age:25,name:"Bob"}


    tb_Older,tb_diff := Older(tom,bob)
    fmt.Printf("Of %s and %s ,%s is older by %d years\n",
                tom.name,bob.name,tb_Older.name,tb_diff)

    r1 := Rectangle{12,2}
    r2 := Rectangle{9,4}
    fmt.Printf("Area of r1 is:",area(r1))
    fmt.Printf("Area of r2 is:",area(r2))
}
